package com.oig.sys.base.dao;

import com.oig.sys.base.entity.TbInnerAddress;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @author wuxl
 */
public interface ITbInnerAddressDao extends JpaRepository<TbInnerAddress, String> {


    @Query("from TbInnerAddress i where i.code  like CONCAT('%',:searchWord,'%') or i.name  like CONCAT('%',:searchWord,'%') ")
    List<TbInnerAddress> findTopTen(@Param("searchWord") String searchWord, Pageable pageable);


}
